<?php
session_start(); 
if(!isset($_SESSION['userName'])){
header( 'location:../../index.php' ); 
}
	include("../../conf/connect.php");
	$serial=$_GET['serial'];
	$hid = $_GET['hid']; 
	$user_id =$_SESSION['user_id'];
	$bid = $_GET['bid'];
	$mmid = $_GET['mmid'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="../../style.css" media="screen" />
	<link rel="shortcut icon" href="../images/favicon.ico" />
</head>
<body class="iub_back">
<?php
		if($bid ==1)
			$sql = "SELECT $serial FROM raw_data WHERE user_id='$user_id' and hid='$hid' and rid='$bid'" ;
		else if($bid ==2)
			$sql = "SELECT $serial FROM raw_data WHERE user_id='$user_id' and hid='$hid' and rid='$bid' and id='$mmid'" ;
		$result = mysql_query($sql);
		$row = mysql_fetch_array($result);
		
?>
<?php if($serial=='q1'){?>
	<form method="post" action="update_operation.php?qus=<?php echo $serial;?>&amp;bid=<?php echo $bid;?>&amp;mmid=<?php echo $mmid;?>">
	
		<table align="center" class="table_border">
			<tr align="left">
					<td align="left"><?php if($bid !=2){?>Rspndt<?php }else{ ?>Name<?php }?> :<input type="hidden" name="hid" value="<?php echo $hid;?>" /></td>
			</tr>
			<tr align="left">
					<td align="left"><input type="text" name="data[name]" value="<?php echo $row[$serial];?>"  /></td>
					
			</tr>
			<tr>
					<td  align="right"><input type="submit" value="Update"  class="input-box"/></td>
			</tr>
			
		</table>
	</form>
<?php }?>
	
<?php if($serial=='q2'){
	$age=$row[$serial];
?>	
	<form method="post" action="update_operation.php?qus=<?php echo $serial;?>&amp;bid=<?php echo $bid;?>&amp;mmid=<?php echo $mmid;?>">
		<table align="center" class="table_border" >
			<tr align="left">
					<td align="left"> Age :<input type="hidden" name="hid" value="<?php echo $hid;?>" /></td>
			</tr>
			<tr align="left">
					<td align="left"> 
						<select name="data[1st]">
							<?php for($i=0;$i<=10;$i++){?>
							<option value="<?php echo $i;?>" <?php if($i==$age){?>selected="selected" <?php }?>><?php echo $i;?></option>
							<?php  }?>
						</select> 
					</td>
			</tr>
			<tr>
					<td align="right"><input type="submit" value="Update" class="input-box"/></td>
			</tr>
			
		</table>
	</form>
<?php }?>
<?php if($serial=='q3'){
	  $sex=$row[$serial];
?>
	<form method="post" action="update_operation.php?qus=<?php echo $serial;?>&amp;bid=<?php echo $bid;?>&amp;mmid=<?php echo $mmid;?>">
		<table align="center" class="table_border" >
			<tr align="left">
					<td align="left" valign="top"> Sex :<input type="hidden" name="hid" value="<?php echo $hid;?>" /></td>
			</tr>
			<tr align="left">
					
					<td align="left">
						<input  type="radio" name="data[sex]" <?php if($sex==1){?> checked="checked"<?php }?>value="1" /> Male <br />
						<input  type="radio" name="data[sex]" <?php if($sex==3){?> checked="checked"<?php }?>value="3" /> Female  
					</td>
			</tr>
			<tr>
					<td align="right"><input type="submit" value="Update" class="input-box" /></td>
			</tr>
			
		</table>
	</form>
<?php }?>
<?php if($serial=='q4'){
	  $mstatus=$row[$serial];
?>
	<form method="post" action="update_operation.php?qus=<?php echo $serial;?>&amp;bid=<?php echo $bid;?>&amp;mmid=<?php echo $mmid;?>">
		<table align="center" class="table_border" >
			<tr align="left">
					<td align="left" valign="top">Mrtl Stts : <input type="hidden" name="hid" value="<?php echo $hid;?>" /></td>
			</tr>
			<tr align="left">
					
					<td align="left">
						<input  type="radio" name="data[mStatus]" <?php if($mstatus==01){?> checked="checked"<?php }?>value="01" />01-Unmarried <br />
						<input  type="radio" name="data[mStatus]" <?php if($mstatus==02){?> checked="checked"<?php }?> value="02" />02-Married  <br />
						<input type="radio" name="data[mStatus]" <?php if($mstatus==03){?> checked="checked"<?php }?>value="03" /> 03-Separated<br />
						<input  type="radio" name="data[mStatus]" <?php if($mstatus==04){?> checked="checked"<?php }?>value="04" />04-Divorced <br />
						<input  type="radio" name="data[mStatus]" <?php if($mstatus==05){?> checked="checked"<?php }?>value="05 " />05-Widowed  
						
					</td>
			</tr>
			<tr>
					<td align="right"><input type="submit" value="Update" class="input-box" /></td>
			</tr>
			
		</table>
	</form>
<?php }?>
<?php if($serial=='q5'){
	$relstatus=$row[$serial];
?>
	<form method="post" action="update_operation.php?qus=<?php echo $serial;?>&amp;bid=<?php echo $bid;?>&amp;mmid=<?php echo $mmid;?>">
		<table align="center" class="table_border" >
			<tr align="left">
					<td align="left" valign="top">Rel W HH :<input type="hidden" name="hid" value="<?php echo $hid;?>" /></td>
			</tr>
			<tr align="left">
					
					<td align="left">
							<select name="data[relation]">
								<option value="01" <?php if($relstatus==01){?> selected="selected"<?php }?>> 01-Self</option>
								<option value="02" <?php if($relstatus==02){?> selected="selected"<?php }?>> 02-Husband</option>
								<option value="03" <?php if($relstatus==03){?> selected="selected"<?php }?>> 03-Wife</option>
								<option value="04" <?php if($relstatus==04){?> selected="selected"<?php }?>> 04-Son</option>
								<option value="05" <?php if($relstatus==05){?> selected="selected"<?php }?>> 05-Daughter</option>
								<option value="06" <?php if($relstatus==06){?> selected="selected"<?php }?>> 06-Step Son</option>
								<option value="07" <?php if($relstatus==07){?> selected="selected"<?php }?>> 07-Step Daughter</option>
								<option value="08" <?php if($relstatus==08){?> selected="selected"<?php }?>> 08-</option>
								<option value="09" <?php if($relstatus==09){?> selected="selected"<?php }?>> 09-</option>
								<option value="10" <?php if($relstatus==10){?> selected="selected"<?php }?>> 10-Father</option>
								<option value="11" <?php if($relstatus==11){?> selected="selected"<?php }?>> 11-Mother</option>
								<option value="12" <?php if($relstatus==12){?> selected="selected"<?php }?>> 12-Step Father</option>
								<option value="13" <?php if($relstatus==13){?> selected="selected"<?php }?>> 13-Step Mother</option>
								<option value="14" <?php if($relstatus==14){?> selected="selected"<?php }?>> 14-Brother</option>
								<option value="15" <?php if($relstatus==15){?> selected="selected"<?php }?>> 15-Sister</option>
								<option value="16" <?php if($relstatus==16){?> selected="selected"<?php }?>> 16-Step Brother</option>
								<option value="17" <?php if($relstatus==17){?> selected="selected"<?php }?>> 17-Step Sister</option>
								<option value="18" <?php if($relstatus==18){?> selected="selected"<?php }?>> 18-</option>
								<option value="19" <?php if($relstatus==19){?> selected="selected"<?php }?>> 19-</option>
								<option value="20" <?php if($relstatus==20){?> selected="selected"<?php }?>> 20-Father-in-law</option>
								<option value="21" <?php if($relstatus==21){?> selected="selected"<?php }?>> 21-Mother-in-law</option>
								<option value="22" <?php if($relstatus==22){?> selected="selected"<?php }?>> 22-</option>
								<option value="23" <?php if($relstatus==23){?> selected="selected"<?php }?>> 23-</option>
								<option value="24" <?php if($relstatus==24){?> selected="selected"<?php }?>> 24-Brother-in-law</option>
								<option value="25" <?php if($relstatus==25){?> selected="selected"<?php }?>> 25-</option>
								<option value="26" <?php if($relstatus==26){?> selected="selected"<?php }?>> 26-</option>
								<option value="27" <?php if($relstatus==27){?> selected="selected"<?php }?>> 27-</option>
								<option value="28" <?php if($relstatus==28){?> selected="selected"<?php }?>> 28-</option>
								<option value="29" <?php if($relstatus==29){?> selected="selected"<?php }?>> 29-</option>
								<option value="30" <?php if($relstatus==30){?> selected="selected"<?php }?>> 30-</option>
								<option value="31"> 31- Sister-in-law</option>
								<option value="32"> 32-</option>
								<option value="33"> 33-Grandson</option>
								<option value="34"> 34-</option>
								<option value="35"> 35-Mat. Grandfather</option>
								<option value="36"> 36-Mat. Grandmother</option>
								<option value="37"> 37-</option>
								<option value="38"> 38-</option>
								<option value="39"> 39-Pat. Grandfather</option>
								<option value="40"> 40-Pat. Grandmother</option>
								<option value="41"> 41-</option>
								<option value="42"> 42-</option>
								<option value="43"> 43-Maternal Uncle</option>
								<option value="44"> 44-</option>
								<option value="45"> 45-Maternal Aunt</option>
								<option value="46"> 46-</option>
								<option value="47"> 47-</option>
								<option value="48"> 48-</option>
								<option value="49"> 49-</option>
								<option value="50"> 50-</option>
								<option value="51"> 51-</option>
								<option value="52"> 52-</option>
								<option value="53"> 53-</option>
								<option value="54"> 54-</option>
								<option value="55"> 55-</option>
								<option value="56"> 56-</option>
								<option value="57"> 57-</option>
								<option value="58"> 58-</option>
								<option value="59"> 59-</option>
								<option value="60"> 60-</option>
								<option value="61"> 61-</option>
								<option value="62"> 62-</option>
								<option value="63"> 63-</option>
								<option value="64"> 64-</option>
								<option value="65"> 65-</option>
								<option value="66"> 66-</option>
								<option value="67"> 67-</option>
								<option value="68"> 68-</option>
								<option value="69"> 69-</option>
								<option value="70"> 70-</option>
								<option value="71"> 71-</option>
								<option value="72"> 72-</option>
								<option value="73"> 73-</option>
								<option value="74"> 74-</option>
								<option value="75"> 75-</option>
								<option value="76"> 76-</option>
								<option value="77"> 77-</option>
							</select>
					</td>
			</tr>
			<tr>
					<td align="right"><input type="submit" value="Update"  class="input-box"/></td>
			</tr>
			
		</table>
	</form>
<?php }?>

<?php if($serial=='q6'){?>
	<form method="post" action="update_operation.php?qus=<?php echo $serial;?>&amp;bid=<?php echo $bid;?>&amp;mmid=<?php echo $mmid;?>">
		<table align="center" class="table_border" >
			<tr align="left">
					<td align="left" valign="top"> Schlng :<input type="hidden" name="hid" value="<?php echo $hid;?>" /></td>
			</tr>
			<tr align="left">					
					<td align="left"> 
						<select name="data[s1]">
							<option value="0">0</option>
							<option value="1">1</option>
							<option value="2">2</option>
							<option value="3">3</option>
							<option value="4">4</option>
							<option value="5">5</option>
							<option value="6">6</option>
							<option value="7">7</option>
							<option value="8">8</option>
							<option value="9">9</option>
						</select> 
						<select name="data[s2]">
							<option value="0">0</option>
							<option value="1">1</option>
							<option value="2">2</option>
							<option value="3">3</option>
							<option value="4">4</option>
							<option value="5">5</option>
							<option value="6">6</option>
							<option value="7">7</option>
							<option value="8">8</option>
							<option value="9">9</option>
						</select>
					</td>
			</tr>
			<tr>
					<td align="right"><input type="submit" value="Update" class="input-box" /></td>
			</tr>
			
		</table>
	</form>
<?php }?>

<?php if($serial=='q7'){
	$occstatus=$row[$serial];
?>
	<form method="post" action="update_operation.php?qus=<?php echo $serial;?>&amp;bid=<?php echo $bid;?>&amp;mmid=<?php echo $mmid;?>">
		<table align="center"  class="table_border">
			<tr align="left">
					<td align="left" valign="top"> Occptn :<input type="hidden" name="hid" value="<?php echo $hid;?>" /></td>
			</tr>
			<tr align="left">
					
					<td align="left"> 
							<select name="data[occupation]">
								<option value="01" <?php if($occstatus==01){?> selected="selected"<?php }?>> 01-Farmer(Own land) </option>
								<option value="02" <?php if($occstatus==02){?> selected="selected"<?php }?>> 02-Farmer(Other's land) </option>
								<option value="03" <?php if($occstatus==03){?> selected="selected"<?php }?>> 03-Agr Labour </option>
								<option value="04" <?php if($occstatus==04){?> selected="selected"<?php }?>> 04-Labour </option>
								<option value="05" <?php if($occstatus==05){?> selected="selected"<?php }?>> 05-Head Worker </option>
								<option value="06" <?php if($occstatus==06){?> selected="selected"<?php }?>> 06-Paddy Business</option>
								<option value="07" <?php if($occstatus==07){?> selected="selected"<?php }?>> 07-Jute Business</option>
								<option value="08" <?php if($occstatus==08){?> selected="selected"<?php }?>> 08-</option>
								<option value="09" <?php if($occstatus==09){?> selected="selected"<?php }?>> 09-Contructor</option>
								<option value="10" <?php if($occstatus==10){?> selected="selected"<?php }?>> 10-Departmental store</option>
								<option value="11" <?php if($occstatus==11){?> selected="selected"<?php }?>> 11-Drug Store</option>
								<option value="12" <?php if($occstatus==12){?> selected="selected"<?php }?>> 12-</option>
								<option value="13" <?php if($occstatus==13){?> selected="selected"<?php }?>> 13-Restaurant</option>
								<option value="14" <?php if($occstatus==14){?> selected="selected"<?php }?>> 14-Fish Business</option>
								<option value="15" <?php if($occstatus==15){?> selected="selected"<?php }?>> 15-</option>
								<option value="16" <?php if($occstatus==16){?> selected="selected"<?php }?>> 16-</option>
								<option value="17" <?php if($occstatus==17){?> selected="selected"<?php }?>> 17-Cattle Business</option>
								<option value="18" <?php if($occstatus==18){?> selected="selected"<?php }?>> 18-Spectacle Shop</option>
								<option value="19" <?php if($occstatus==19){?> selected="selected"<?php }?>> 19-Rikshaw Business</option>
								<option value="20" <?php if($occstatus==20){?> selected="selected"<?php }?>> 20-Tempu Business</option>
								<option value="21" <?php if($occstatus==21){?> selected="selected"<?php }?>> 21-Other Business</option>
								<option value="22"> 22-Rikshaw Puller</option>
								<option value="23"> 23-Fisherman</option>
								<option value="24"> 24-</option>
								<option value="25"> 25-</option>
								<option value="26"> 26-Carpenter</option>
								<option value="27"> 27-</option>
								<option value="28"> 28-</option>
								<option value="29"> 29-</option>
								<option value="30"> 30-</option>
								<option value="31"> 31-</option>
								<option value="32"> 32-Tailor</option>
								<option value="33"> 33-Student</option>
								<option value="34"> 34-Retired</option>
								<option value="35"> 35-Unable</option>
								<option value="36"> 36-Finding job</option>
								<option value="37"> 37-No Job</option>
								<option value="38"> 38-Teacher(Govt Sch)</option>
								<option value="39"> 39-Teacher(Non-Govt Sch)</option>
								<option value="40"> 40-Teacher(Govt Clg)</option>
								<option value="41"> 40-Teacher(Non-Govt Clg)</option>
								<option value="42"> 42-</option>
								<option value="43"> 43-</option>
								<option value="44"> 44-Govt. Job(Health)</option>
								<option value="45"> 45-Police/Army/Ansar</option>
								<option value="46"> 46-Job(Post office)</option>
								<option value="47"> 47-Govt Jute Mills</option>
								<option value="48"> 48-Worker(Bank)</option>
								<option value="49"> 49-Worker(Hospital)</option>
								<option value="50"> 50-NGO worker</option>
								<option value="51"> 51-Garment Worker</option>
								<option value="52"> 52-Non Govt. Jute</option>
								<option value="53"> 53-Shop worker</option>
								<option value="54"> 54-Foreign Job</option>
								<option value="55"> 55-Other Job</option>
								<option value="56"> 56-Tempu Driver</option>
								<option value="57"> 57-Bus Driver</option>
								<option value="58"> 58-Mechanics</option>
								<option value="59"> 59-Doctor(MBBS)</option>
								<option value="60"> 60-Paramedical</option>
								<option value="61"> 61-Vill. Doctor</option>
								<option value="62"> 62-Engineer</option>
								<option value="63"> 63-</option>
								<option value="64"> 64-Home worker</option>
								<option value="65"> 65-</option>
								<option value="66"> 66-</option>
								<option value="67"> 67-</option>
								<option value="68"> 68-</option>
								<option value="69"> 69-</option>
								<option value="70"> 70-</option>
								<option value="71"> 71-</option>
							</select>
					</td>
			</tr>
			<tr>
					<td align="right">
						<input type="submit" value="Update" class="input-box" />&nbsp;
					</td>
			</tr>
			
		</table>
	</form>
<?php }?>

<?php if($serial=='q8'){?>
	<form method="post" action="update_operation.php?qus=<?php echo $serial;?>&amp;bid=<?php echo $bid;?>&amp;mmid=<?php echo $mmid;?>">
		<table align="center"  class="table_border">
			<tr align="left">
					<td align="left" valign="top"> Lst Dr Vist:<input type="hidden" name="hid" value="<?php echo $hid;?>" /></td>
			</tr>
			<tr align="left">
					
					<td align="left"> 
							<select name="data[visit]">
										<option value="0-2"> 0-2</option>
										<option value="2-6"> 2-6</option>
										<option value="8-12"> 8-12</option>
										<option value=">12"> >12</option>
									</select> Mnth
					</td>
			</tr>
			<tr>
					<td align="right">
						<input type="submit" value="Update" class="input-box" />&nbsp;
					</td>
			</tr>
			
		</table>
	</form>
<?php }?>

<?php if($serial=='q9'){?>
	<form method="post" action="update_operation.php?qus=<?php echo $serial;?>&amp;bid=<?php echo $bid;?>&amp;mmid=<?php echo $mmid;?>">
		<table align="center"  class="table_border">
			<tr align="left">
					<td align="left" valign="top"> Dgnsd :<input type="hidden" name="hid" value="<?php echo $hid;?>" /></td>
			</tr>
			<tr align="left">
					
					<td align="left"> 
						<input type="checkbox" name="data[diseases_g]" value="Gastric" />Gastric<br />
						<input type="checkbox" name="data[diseases_d]" value="Hrt Cnd" />Hrt Cnd<br />
						<input type="checkbox" name="data[diseases_di]" value="Diabetes" />Diabetes<br />
						<input type="checkbox" name="data[diseases_o]" value="Other" />Other<br/>
						<input type="text" name="ods"  size="16" />
					</td>
			</tr>
			<tr>
					<td align="right">
						<input type="submit" value="Update" class="input-box" />&nbsp;
					</td>
			</tr>
			
		</table>
	</form>
<?php }?>
</body>
</html>